{layout name="public/layout" /}
{include file='yxnavbar'}


{include file='../../plugin/shopplan/template/web/shopplan_common_nav'}
{if $system['is_shop_plan']==1}
<form id="form2"  action="{php echo createWebUrlPlugin('shopplan.showspecial',array('id'=>$id,'themeid'=>$themeid,'storeid'=>$storeid,'shopid'=>$shopid));}" enctype ="multipart/form-data" method="post">

<div class="panel panel-default" role="tabpanel" style="">
	<div class="col-xs-12 col-sm-2 col-md-2" style="float:left;">
		<select name="shopid" id="mySelect">
			{loop $shopconfig $k $item}
				<option value="{$item['shopid']}" {if $item['shopid']== $shopid}selected{/if}>{$item['name']}</option>
			{/loop}
		</select>	
	</div>	

    <div class="panel-heading">特殊日期管理</div>
       <div class="panel-body" >	
            <div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label"></label>
                <div class="col-sm-9 col-xs-12">
					<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>日期</label>
					<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>适用规划</label>
					<label class="col-sm-2 col-xs-12 control-label"><span style="color: red;">*</span>操作</label>
					<div ><span style="color: red;">*</span>规划时间段概况</div>
				</div>			
				{loop $special_rules $k1 $special_rule}
				<label class="col-sm-2 col-xs-12 control-label"><b></b></label>
				<div class="col-sm-9 col-xs-12">
					<label class="col-sm-2 col-xs-12 control-label"><input type="checkbox" name="plan_s_work00_time[{$k1}][workdays]" value="{$special_rule['workdays']}" checked="checked">{$special_rule['workdays']}</label>
					<label class="col-sm-2 col-xs-12 control-label">
						<select name="plan_s_work00_time[{$k1}][tplid]">
							<option disabled selected>选择时间规划</option>
							<option value="holiday" {if $special_rule['tplid'] == 'holiday'}selected{/if}>休息日</option>
							{loop $tplitem $k $tplitems}
								<option value="{$tplitems['id']}" {if $special_rule['tplid'] == $tplitems['id']}selected{/if}>{$tplitems['tplname']}</option>
							{/loop}
						</select>						
					</label>
					<label class="col-sm-2 col-xs-12 control-label">
						<a style="background-color: #ca4242; padding: 3px 10px;border-radius:5px; text-align:center;color: white;" href="{php echo createWebUrlPlugin('shopplan.delspecials',array('id'=>$id,'themeid'=>$themeid,'storeid'=>$storeid,'special_rules_id'=>$k1,'shopid'=>$shopid,'shopname'=>$shopname));}" onclick="if(!confirm('删除后将不可恢复，确定删除吗?')) return false;">删除</a>
					</label>
					<div >
						{loop $specialinfo[$k1] $k $times}
							<span>【{$times}/{$specialnums[$k1][$k]}】</span>
						{/loop}
					</div>
				</div>	
				{/loop}	

			</div>
		</div>
        <div class="form-group">
			<label class="col-sm-2 col-xs-12 control-label"><b></b></label>
			<div class="col-sm-9 col-xs-12">
				<span class="help-block">
					<a style="background-color:#428bca;padding: 5px 10px; color: white;border-radius:5px;" href="{php echo createWebUrlPlugin('shopplan.addspecials',array('themeid'=>$themeid,'storeid'=>$storeid,'shopid'=>$shopid));}"><i class="glyphicon glyphicon-plus" title="adddays"></i>新增特殊日期</a>
				</span>		
			</div>
		</div>		
		

		
		
	</div>
</div>


			
<div class="form-group">
	<div class="col-sm-8 col-xs-12">
		<input name="submit" id="btn_submit" type="submit" value="提交" class="btn btn-primary col-lg-1" >
		<input type="hidden" name="__token__" value="{$Request.token}" />				
	</div>
</div>	 

</form>	
{/if} 
<script>
	//分店选择事件
    $("#mySelect").change(function(){  
		//添加所需要执行的操作代码
		var shopid =$("#mySelect").val();
		var success_redirect ="{php echo createWebUrlPlugin('shopplan.showspecial',array('themeid'=>$themeid));}";
		    success_redirect+='&shopid='+shopid;
            window.location.href = success_redirect;
		  
    })    
</script>


